package com.arcadia.d2.hero_attributes;

import java.util.ArrayList;

import com.arcadia.d2.hero_attributes.attack.Attack;
import com.arcadia.d2.hero_attributes.attack.AttackSpeed;
import com.arcadia.d2.hero_attributes.attack.Crit;
import com.arcadia.d2.hero_attributes.skill.Ability;
import com.arcadia.d2.item_attributes.Item;
public class Hero{

	private int id;
	private String name;
	private int lv;
	private Item[] itemSlot;

	private Attack attack;
	private Crit[] crit;
	private AttackSpeed attackSpeed;
	private Attribute attribute;
	private Armor armor;
	private MagicRes magicRes;
	private ArrayList<Ability> abilities;
	
	//Constructors

	

	
	//Accessors
	public int getId() {
		return id;
	}
	public String getName() {
		return name;
	}
	public Attack getAttack() {
		return attack;
	}
	public Crit[] getCrit(){
		return crit;
	}
	public AttackSpeed getAttackSpeed() {
		return attackSpeed;
	}
	public Attribute getAttribute() {
		return attribute;
	}
	public Armor getArmor() {
		return armor;
	}
	public MagicRes getMagicRes(){
		return magicRes;
	}
	public ArrayList<Ability> getAbilities() {
		return abilities;
	}
	
	public int getLevel(){
		return lv;
	}
	
	public Item[] getItem(){
		return itemSlot;
	}

	
	//Mutators
	public void setId(int id) {
		this.id = id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setAttack(Attack attack) {
		this.attack = attack;
	}
	public void setCrit(Crit[] crit){
		this.crit = crit;
	}
	public void setAttackSpeed(AttackSpeed attackSpeed) {
		this.attackSpeed = attackSpeed;
	}
	public void setAttributes(Attribute attribute) {
		this.attribute = attribute;
	}
	public void setArmor(Armor armor) {
		this.armor = armor;
	}
	public void setMagicRes(MagicRes magicRes) {
		this.magicRes = magicRes;
	}
	public void setAbilities() {

	}
	
	public void setLevel(int lv){
		this.lv = lv;
	}
	
	public void setItem(Item[] itemSlot){
		this.itemSlot = itemSlot;
	}
	
	public void equip(Item[] itemSlot) {
		
		for (int i = 0 ; i < 6; i++){
			this.attack.setGreen(itemSlot[i].getAttack().getGreen());
			this.attackSpeed.setIAS(itemSlot[i].getAttackSpeed().getIAS());
			this.attribute.setIStrengthFromItem(itemSlot[i].getAttribute().getIStrengthFromItem());
			this.attribute.setIAgilityFromItem(itemSlot[i].getAttribute().getIAgilityFromItem());
			this.attribute.setIIntelligenceFromItem(itemSlot[i].getAttribute().getIIntelligenceFromItem());
			this.armor.setIArmor(itemSlot[i].getArmor().getBaseArmor(), itemSlot[i].getAttribute().getIAgilityFromItem());
			this.magicRes.setIMagicResistance(itemSlot[i].getMagicRes().getBase());
			/*crit, ability*/
		}
	}


}
